
 <!DOCTYPE HTML>
<html>
<head>
    <title>核查中-公共列表页面</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <script src="/static/js/common/common.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="mini-toolbar" style="padding: 2px; border-bottom: 0;">
    <table style="width: 100%;">
        <tr>
            <td style="width: 100%;">
                <#list leftList >
                    <#items as resource>
                        <#switch resource.type >
                            <#case 700>
                                <a class="mini-button" plain="true" iconCls="${resource.icon!''}"
                                   style="width:${resource.width!'120'}px;"
                                        <#if (resource.action)?? && (resource.action) != "" && (resource.action) != " ">
                                            onclick="${resource.action}"
                                        </#if>
                                >${resource.name}</a>
                                <#break>
                            <#case 800>
                                <input name="${resource.field!''}" class="mini-textbox"
                                       emptyText="${resource.prompt!''}"
                                       style="width:${resource.width!150}px;" ${resource.extension!''}/>
                                <#break>
                            <#case 820>
                                <input name="${resource.field!''}" class="mini-combobox"
                                       emptyText="${resource.prompt!''}"
                                       style="width:${resource.width!150}px;" ${resource.extension!''} valueField="id"
                                       textField="text"
                                        <#if (resource.action)?? && (resource.action) != "" && (resource.action) != " ">
                                            url="${resource.action}"
                                        </#if>
                                />
                                <#break>
                            <#case 1100>
                                <input name="${resource.field!''}" class="mini-checkbox" text="${resource.name}"
                                       onvaluechanged="${resource.action!''}" ${resource.extension!''} />
                                <#break>
                            <#case 1200>
                                <input name="${resource.field!''}" class="mini-datepicker"
                                       emptyText="${resource.prompt!''}"
                                       style="width:${resource.width!150}px;" ${resource.extension!''} />
                                <#break>
                            <#default>
                        </#switch>
                    </#items>
                    <span class="separator"></span>
                </#list>
            </td>
            <td style="white-space: nowrap;">
                <#if rightList?? && (rightList?size &gt; 0) >
                    <#list rightList>
                        <#items as resource>
                            <#switch resource.type>
                                <#case 800>
                                    <input name="${resource.field!''}" class="mini-textbox"
                                           emptyText="${resource.prompt!''}" style="width:${resource.width!150}px;"
                                           onenter="search" ${resource.extension!''}/>
                                    <#break>
                                <#case 820>
                                    <input name="${resource.field!''}" class="mini-combobox"
                                           emptyText="${resource.prompt!''}"
                                           style="width:${resource.width!150}px;" ${resource.extension!''}
                                           valueField="id" textField="text"
                                            <#if (resource.action)?? && (resource.action) != "" && (resource.action) != " ">
                                                url="${resource.action}&detailid=${resource.detailid!''}"
                                            </#if>
                                    />
                                    <#break>
                                <#case 860>
                                    <input name="${resource.field!''}" class="mini-datepicker"
                                           emptyText="${resource.prompt!''}"
                                           style="width:${resource.width!150}px;" ${resource.extension!''} />
                                    <#break>
                                <#case 880>
                                    <#if resource.label?? && resource.label != "" && resource.label != " " >
                                        <label style="font-family: Verdana;">${resource.label}: </label>
                                    </#if>
                                    <input name="${resource.field!''}" class="mini-treeselect"
                                           style="width:${resource.width!150}px;" ${resource.extension!''}
                                           valueField="id" textField="text" multiSelect="false"
                                            <#if (resource.action)?? && (resource.action) != "" && (resource.action) != " ">
                                                url="${path}/${resource.action}&detailid=${resource.detailid!''}"
                                            </#if>
                                    />
                                    <#break>
                                <#default>
                            </#switch>
                        </#items>
                    </#list>
                    <a class="mini-button" iconCls="fa fa-search" plain="true" onclick="search">查询</a>
                    <a class="mini-button" iconCls="fa fa-refresh" plain="true" onclick="clear">清除筛选条件</a>
                </#if>
            </td>
        </tr>
    </table>
</div>
<div class="mini-fit">
    <#if grid??>
        <div id="datagrid1" class="mini-datagrid" style="width: 100%; height: 100%;"
             ajaxType="get" ${grid.extension!''} sizeList="[50,100,200]" pageSize="50" virtualScroll="false" allowSortColumn="true"
             showLoading="true" allowAlternating="true" multiSelect="true" idField="id" allowCellWrap="true"
                <#if (grid.action)?? && (grid.action) != "" && (grid.action) != " ">
                    url="${grid.action}"
                <#else>
                    url="/aa"
                </#if>
        >
            <#if fieldList?? && (fieldList?size &gt; 0) >
                <div property="columns">
                    <div type="indexcolumn" width="50px" headerAlign="center">序号</div>
                    <#list fieldList>
                        <#items as resource >
                            <div name="${resource.field}" field="${resource.field}" width="120px"
                                 align="center" headerAlign="center"  sortField="${resource.field}"
                                 allowSort="true" ${resource.extension!''}>${resource.name!''}
                                <#if (resource.action)?? && (resource.action) != "" && (resource.action) != " ">
                                    ${resource.action!''}
                                </#if>
                            </div>
                        </#items>
                    </#list>
                    <#list fieldList1>
                        <#items as resource >
                            <div name="${resource.field}" field="${resource.field}" width="220px"
                                 align="center" headerAlign="center"
                                 allowSort="false" ${resource.extension!''}>${resource.name!''}
                                <#if (resource.action)?? && (resource.action) != "" && (resource.action) != " ">
                                    ${resource.action!''}
                                </#if>
                            </div>
                        </#items>
                    </#list>
                    <#if midList?? && (midList?size &gt; 0) >
                        <div name="action" headerAlign="center" align="center" renderer="onActionRenderer" cellStyle="padding:0;" allowSort="false" width="220px">
                            操作
                        </div>
                    </#if>
                </div>
            </#if>
        </div>
    </#if>
</div>
<script type="text/javascript">
    mini.parse();
    var grid = mini.get("datagrid1");
    var url = grid.url;
    grid.load();
    /**
     * 给状态列加颜色
     */
    grid.on("drawcell", function(res){
        var record = res.record;
        var field = res.field;
        var value = res.value;
        if (field === "zt" || field === 'xd' || field === 'state' || field === 'spzt' || field === 'finalstate'){
            res.cellStyle = "color: #008c8c;";
        }
    });

    // 控制核查失败的操作列
    function onActionRenderer(e) {
        var s = "";
        var row1 = e.row;
        <#if midList?? && (midList?size &gt; 0) >
        <#list midList>
        <#items as resource>
        <#if resource.flowid=='1'>
        //再次发起核查
        if (row1.failurenum == '1' && row1.pushState == '4') {
            s += "&nbsp;<a class=\"mini-button ${resource.icon}\"  name=\"midbtn_${resource.field}\" resid=\"${resource.id?c}\" onclick=\"${(resource.action)}\"  >&nbsp;${resource.name}&nbsp;</a>&nbsp";
        }
        //转入原侦查机关
        <#elseif resource.flowid=='2'>
        if (row1.failurenum == '2' && row1.pushState == '4') {
            s += "&nbsp;<a class=\"mini-button ${resource.icon}\"  name=\"midbtn_${resource.field}\" resid=\"${resource.id?c}\" onclick=\"${(resource.action)}\"  >&nbsp;${resource.name}&nbsp;</a>&nbsp";
        }
        // 再次发起核查的编辑按钮
        <#elseif resource.flowid=='3'>
        if (row1.failurenum == '1' && row1.pushState == '4') {
            s += "&nbsp;<a class=\"mini-button ${resource.icon}\"  name=\"midbtn_${resource.field}\" resid=\"${resource.id?c}\" onclick=\"${(resource.action)}\"  >&nbsp;${resource.name}&nbsp;</a>&nbsp";
        }
        // 核查失败原因按钮
        <#elseif resource.flowid=='4'>
            s += "&nbsp;<a class=\"mini-button ${resource.icon}\"  name=\"midbtn_${resource.field}\" resid=\"${resource.id?c}\" onclick=\"${(resource.action)}\"  >&nbsp;${resource.name}&nbsp;</a>&nbsp";
        <#else>// 查看
        s += "&nbsp;<a class=\"mini-button ${resource.icon}\"  name=\"midbtn_${resource.field}\" resid=\"${resource.id?c}\" onclick=\"${(resource.action)}\"  >&nbsp;${resource.name}&nbsp;</a>&nbsp";
        </#if>
        </#items>
        </#list>
        </#if>
        return s;
    }

    function search() {
        var params = {};
        <#if rightList?? && (rightList?size &gt; 0) >
        <#list rightList>
        <#items as resource>
        var key = "${((resource.field!'')?length>0)?string((resource.field!''),'null')}";
        if (key != null) {
            var value = mini.getByName(key).getValue();
            if (860 == ${resource.type}) {
                params[key] = mini.formatDate(value, "yyyy-MM-dd HH:mm:ss");
            } else {
                params[key] = value;
            }
        }
        </#items>
        </#list>
        </#if>
        grid.load(params);
    }
    function clear() {
        var params = {};
        <#if rightList?? && (rightList?size &gt; 0) >
        <#list rightList>
        <#items as resource>
        var key = "${((resource.field!'')?length>0)?string((resource.field!''),'null')}";
        if (key != null) {
            if(key=='rjStartDate'||key=='rjEndDate'){
                var inputValue=document.getElementById(""+key);
                inputValue.value=null;
            }else{
                mini.getByName(key).setValue(null);
            }
        }
        </#items>
        </#list>
        </#if>
        grid.load(params);
    }
</script>
<script src="/static/js/azbj/yazgl/search_code.js" type="text/javascript"></script>
<#if self.outjs?length gt 0>
    <script src="/static/js/${self.outjs}" type="text/javascript"></script>
</#if>
</body>
</html>